﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SimpleTaskManager.Domain.Entities;

namespace SimpleTaskManager.WebUI.Models
{
    /// <summary>
    /// A class which represent the basic informations of a user.
    /// </summary>
    public class RelatedUsersModel
    {
        /// <summary>
        /// The ID of the User entry
        /// </summary>
        public int UserId { get; set; }
        /// <summary>
        /// The full name of the user
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// The e-mail address of the user
        /// </summary>
        public string Email { get; set; }

        /// <summary>
        /// Creates an empty instance
        /// </summary>
        public RelatedUsersModel() { }

        /// <summary>
        /// Creates an instance based on a user entity.
        /// </summary>
        /// <param name="user">The user entity which data will be feeded to the new object.</param>
        public RelatedUsersModel(User user)
        {
            this.UserId = user.UserID;
            this.Name = user.FirstName + " " + user.LastName;
            this.Email = user.Email;
        }
    }
}